package com.example.myapplication.widgets.calendar.statistics;

import android.graphics.Rect;
import android.text.TextUtils;

public class StatisticsBean {
    // 状态： -1 错误 0 默认 1 正确 2 仅展示日期，没有背景
    public int status;
    public String date;

    public Rect rect;

    public int getDay(){
        if (!TextUtils.isEmpty(date)) {
            try {
                String dateReplace = date.replace("-", "/");
                String[] dateSplit = dateReplace.split("/");
                return Integer.parseInt(dateSplit[2]);
            } catch (Exception ignored){}
        }
        return 1;
    }

    public boolean needDrawDay(){
        return status == 0 || status == 2;
    }
}
